

<div id="payments">
  <h1>确认并支付</h1>
  <p>
    <label>订单编号： <%=@order.id%> </label>
    <a onclick="window.open(this.href,'','resizable=yes,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,width=983,height=400,status'); return false" href="/store/print?id=<%=@order.id%>" title="点击查看详细内容">查看</a>
  </p>
  <p>
    <label>用户账号：</label>
    <%=@user.login%>
  </p>

  <%if @order.discount < 1%>
    <p>
      <label>折扣：</label>
      <%= foramt_percentage @order.discount%>
    </p>

    <p>
      <label>折后衣服金额：</label>
      <span class="yen"><%=@order.discount_product_price%></span>
    </p>
    <p>
      <label>物流运费：</label>
      <span class="yen"><%=@order.logistics_fee if @order.logistic%></span>
    </p>
    <p>
      <label>总计金额：</label>
      <span class="yen"><%=@order.discount_total_price %></span>
    </p>
  <%else%>
    <p>
      <label>衣服金额：</label>
      <span class="yen"><%=@order.total_product_price%></span>
    </p>
    <p>
      <label>物流运费：</label>
      <span class="yen"><%=@order.logistics_fee if @order.logistic%></span>
    </p>
    <p>
      <label>总计金额：</label>
      <span class="yen"><%=@order.total_price%></span>
    </p>
  <%end%>




  <p>
    确认无误，请点击进入支付宝支付页面：
    <% payment_service_for @order.id, ActiveMerchant::Billing::Integrations::Alipay::ACCOUNT,
      :service => :alipay,
      :html => { :id => 'payment-form', :method => :get } do |service| %>
      <% service.discount 0 %>
      <% service.price @order.discount_total_price %>
      <% service.quantity 1 %>
      <% service.seller :email => ActiveMerchant::Billing::Integrations::Alipay::EMAIL %>
      <% service.notify_url url_for(:only_path => false, :action => 'notify') %>
      <% service.return_url url_for(:only_path => false,
        :controller => 'store', :action => 'success') %>
      <% service.show_url url_for(:only_path => false,
        :controller => 'store', :action => 'mine') %>
      <% service.body "TT小站 订单号#{@order.id}" %>
      <% service.charset "utf-8" %>
      <% service.service ActiveMerchant::Billing::Integrations::Alipay::Helper::CREATE_PARTNER_TRADE_BY_BUYER %>
      <% service.payment_type 1 %>
      <% service.subject "TT小站 订单号#{@order.id}" %>
      <% service.agent ActiveMerchant::Billing::Integrations::Alipay::ACCOUNT %>
      <% service.logistics :type => format_logistic_type_for_alipay(@order.logistic.logistic_type),
        :fee => @order.logistics_fee, :payment => 'BUYER_PAY' %>
      <% service.receive :name => @order.address.receiver, :address => @order.address.title,
        :zip => @order.address.post_code, :phone => @order.address.tel, :mobile => @order.address.mobile %>
      <% service.sign %>
      <button type="submit" title="支付宝结算">支付宝结算</button>
    <% end %>
  </p>
  <p class="tips">
	注：本网站使用支付宝担保交易方式，支付页面商户显示为“东莞市虎门宏佳服装厂”，请放心支付。
  </p>
  <img src="/images/background/alipay.gif" id="alipay" />


</div>




